package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BussBannarMapper;
import com.ruoyi.system.domain.BussBannar;
import com.ruoyi.system.service.IBussBannarService;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-26
 */
@Service
public class BussBannarServiceImpl implements IBussBannarService 
{
    @Autowired
    private BussBannarMapper bussBannarMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public BussBannar selectBussBannarById(Long id)
    {
        return bussBannarMapper.selectBussBannarById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param bussBannar 轮播图
     * @return 轮播图
     */
    @Override
    public List<BussBannar> selectBussBannarList(BussBannar bussBannar)
    {
        return bussBannarMapper.selectBussBannarList(bussBannar);
    }

    /**
     * 新增轮播图
     * 
     * @param bussBannar 轮播图
     * @return 结果
     */
    @Override
    public int insertBussBannar(BussBannar bussBannar)
    {
        bussBannar.setCreateTime(DateUtils.getNowDate());
        return bussBannarMapper.insertBussBannar(bussBannar);
    }

    /**
     * 修改轮播图
     * 
     * @param bussBannar 轮播图
     * @return 结果
     */
    @Override
    public int updateBussBannar(BussBannar bussBannar)
    {
        bussBannar.setUpdateTime(DateUtils.getNowDate());
        return bussBannarMapper.updateBussBannar(bussBannar);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteBussBannarByIds(Long[] ids)
    {
        return bussBannarMapper.deleteBussBannarByIds(ids);
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteBussBannarById(Long id)
    {
        return bussBannarMapper.deleteBussBannarById(id);
    }
}
